package com.zhiliao.factory.abstracts.demo1.factory;

import com.zhiliao.factory.abstracts.demo1.bean.CarProduct;
import com.zhiliao.factory.abstracts.demo1.bean.IProduct;
import com.zhiliao.factory.abstracts.tradition.Engine;
import com.zhiliao.factory.abstracts.tradition.Underpan;
import com.zhiliao.factory.abstracts.tradition.Wheel;

/**
 * 作者： zhi-liao
 * 类的作用:
 * 类的创建时间： 2021/5/23 12:02
 */
public class CarFactory implements IFactory<IProduct> {
    @Override
    public IProduct createProduct() {
        Engine engine = new Engine();
        Underpan underpan = new Underpan();
        Wheel wheel = new Wheel();
        CarProduct car = new CarProduct(engine, underpan, wheel);
        return car;
    }
}
